package com.szty.libarytest.longConnect;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by huanghongfa on 2017/7/28.
 */

public class ConnectUtils {

    public static final int REPEAT_TIME = 50;//表示重连次数
    public static int NOW_CONNECT_NUM=0;
    public static String HOST = "47.108.200.115";//域名
    public static  int PORT = 5412;//端口号
//    public static String HOST = "127.0.0.1";//域名
//    public static  int PORT = 3344;//端口号

    public static final int SEND_HEART_TIME = 10;     //心跳包发送间隔
    public static final int HEART_TIMEOUT_TIME = 20;  //心跳包超时时间
    public static final String HEART_MESSAGE = "PING";//心跳包内容
    public static final String RECEIVE_HEART_MESSAGE = "PONG";//接收到的心跳包内容
    public static final int IDLE_TIME = 10;//客户端10s内没有向服务端发送数据
    public static final int TIMEOUT = 5;//设置连接超时时间,超过5s还没连接上便抛出异常

    public static final String QrCodeOPenDoorPath = "/api/guard/qr/check";
    /**
     * 获取当前时间
     *
     * @return
     */
    public static String stringNowTime() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return format.format(new Date());
    }

}
